<?php if (count($coupons)): ?>
<?php foreach ($coupons as $coupon):
if (is_array($shops)) {
    $shop = $shops[$coupon->shop_id];
} else {
    $shop = $shops->as_array();    
} ?> 
<div class="col-lg-6 col-md-6 col-sm-12 coupon-item"> 
    <div class="thumbnail">   
        <div class="col-lg-4 col-md-4 col-sm-12">
            <span class="hlink" data-hlink="<?=base64_encode(Helper_Index::go_coupon_url($coupon)); ?>" data-target="_blank"><img src="<?=$coupon->logo ?>" class="shop-logo" /></span>
        </div>
     
        <div class="col-lg-8 col-md-8 col-sm-12">
            <h4><span class="hlink" data-hlink="<?=base64_encode(Helper_Index::go_coupon_url($coupon)); ?>" data-target="_blank"><?=$coupon->name ?></span></h4>
            
            <span class="hlink btn btn-primary" data-hlink="<?=base64_encode(Helper_Index::go_coupon_url($coupon)); ?>" data-target="_blank">Воспользоваться купоном</span><br />

            <?php
            $date = new DateTime($coupon->end_date); ?>
            <small>Действителен до <strong><?=$date->format('d.m.Y') ?></strong></small>

            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div> 
    </div>
</div>      
<?php endforeach; ?>
<?php else: ?>
<div class="col-lg-12 col-md-12 col-sm-12"> 
    <p>К сожалению, в данной категории пока нет купонов.</p>
</div>
<?php endif; ?>